<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="com.yaodian100.mall.member.util.UserData"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<c-rt:set var="frontContextPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<html>
<head>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.timers-1.2.js"></script>
<script language="javascript">
	$().ready(function(){

		$("#redialog").dialog({
			autoOpen: false,
			bgiframe: true,
			height: 150,
			width:325,
			modal: true
		});
		
		
		$("#codeTip").hide();

		if("${actionResult}" == "code_error"){
			$("#ccodeTip").html("校验码错误");
			$("#ccodeTip").show();
		}

		if("${actionResult}" == "resend_ok"){
			$("#redialog").dialog('open');
		}
		
		if("${actionResult}" != "" && "${actionResult}" != "resend_ok"){
			if('${member.mobileForgetPwdCount}'!='10'){	
				$('#resend').removeAttr('disabled');
				$('#resend').val('点此重发校验码');
			}else{
				$('#resend').val('点此重发校验码');
			}
		}else{
			var left = 300;
			if('${member.mobileForgetPwdCount}'!='10'){	
				$('body').everyTime('1s',function(){
					if(left==0){
						$('body').stopTime ();
						$('#resend').removeAttr('disabled');
						$('#resend').val('点此重发校验码');
						return;
					}
					$('#resend').val('请于'+left+'秒后点此重发校验码');
					left--;
				});
			}else{
				$('#resend').val('点此重发校验码');
			}
		}
		
		$("#submit_data").click(function(){
			var isCorrect = true;
			$("#ccodeTip").hide();
				
			if(($("#ccode").attr('value') == "")){
				$("#ccodeTip").html("请输入校验码");
				$("#ccodeTip").show();
				isCorrect = false;
			}
			if(isCorrect){
				$("#sendpwdForm").submit();
				return false;
			}
		});
		
		$("#resend").click(function(){ $("#resendForm").submit(); });
		$("#dclose").click(function(){ $("#redialog").dialog('close'); });
	});
</script>
</head>
<body>
<DIV id="redialog" title="成功发送手机短信" class="member-reg-alert-ok" style="display:none;">
  <p>已经向您的手机<span class="txt-rd"><strong>${mobile}</strong></span><br />
  发送免费的验证短信。</p>
  <div align="center"> <span style="text-align:center;"><a href="javascript:;" id="dclose" class="btn-mid">关闭</a></span> </div>
</DIV>

<div id="main" class="member-reg">
  	<h3>找回密码</h3>
    <div class="m-regform">
   	   <p  style="margin-left:150px;"class="pointmsg">校验码短信已发送到您的手机：<strong class="txt-rd">${mobile}</strong>，请输入校验码：</p>
   	   <s:form action="forgetpwdmobilechange.do" method="post" id="sendpwdForm">
   	   <input type="hidden" value="${loginID}" name="loginID">
   	  <ul style="margin-left:120px;">
       <li><div><label for="name">校验码：</label></div><div><INPUT size="20" maxlength="8" id="ccode" name="ccode"/><br /><span class="msg rn" id="ccodeTip" style="display:none;">校验码错误</span></div></li>
      </ul>
        <p>&nbsp;</p>
        <p align="center"><a href="javascript:;" class="btn-mid" id="submit_data">确定</a></p>
        </s:form>
        <p>&nbsp;</p>
        <s:form action="resendforgetmobilepwd.do" method="post" id="resendForm">
  			<input type="hidden" value="${loginID}" name="loginID">
  			<input type="hidden" value="${mobile}" name="mobile">
		</s:form>
        <p align="center" id="resendP">如果您<c:if test="${empty actionResult || actionResult == 'resend_ok'}">在5分钟内</c:if>没有收到校验码，<input type="submit" id="resend" value="请于300秒后点此重发校验码"  class="btn-reg-phone" disabled="disabled"/>
        <c:if test="${member.mobileForgetPwdCount == 10}">(已达使用次数上限)</c:if>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
    </div>
    
    	<div class="tips-li">
        <strong>提示：</strong>
          <ul>
            <li>&nbsp; ．校验码短信已发送，请查阅您的手机短信。</li>
            <li>&nbsp; ．耀点100给您发送的手机校验码短信是免费的。</li>
            <li>&nbsp; ．每个帐户一个月内使用短信找回密码最多10次。</li>
          </ul>
     </div>
  </div>
</body>
</html>